import requestControl from "@/utils/request-control";

/*
获取帮助中心目录和对应文章的列表列表
 */
export function getDirectoryList(params){
  return  requestControl({
    url:'/directory',
    method: 'get',
    params:{
      ...params
    },
    handleError: true,
  })
}

export function getChapter(params){
  if (params.id > 0){
    return requestControl({
      url:`/chapter/${params.id}`,
      method:'get',

    })
  }else {
    return requestControl({
      url:`/chapter/${params.id}`,
      method:'get',
      params:{
        ...params
      }
    })
  }

}

export function  getChapterList(params){
  return requestControl({
    url:'/chapter',
    method:'get',
    params:{
      ...params
    }
  })
}

export function getUpToDateLog(params){
  return requestControl({
    url:'/chapter/getUpToDateLog',
    method:'get',
    params:{
      ...params
    }
  })
}
